#ifndef DB_DAT_H
#define DB_DAT_H
#include "pt_jt808.h"
//0x0001 term common reply
typedef struct _TERM_COM_RPY_FM
{
	int rpySerNum;
	int rpyId;
	char resu[20];
}TERM_COM_RPY_FM;

//0x0100 term register
typedef struct _TERM_REG_FM
{
	char autuher[20];
	int  city;
	int  color;
	char license[20];
	char no1[20];
	char producer[20];
	int  province;
	char type1[24];
}TERM_REG_FM;

//0x0200 position report
typedef struct _POS_BASIC_FM
{
	int altitude;
	int direction;
	float lat;
	float lng;
	float speed;
	int status;
	char time[20];
	int warning;
}POS_BASIC_FM;

typedef struct _POS_ADD_FM
{
	long area_id;
	char areatype;
	char direction;
	float mileage;
	float oilmass;
	char positiontype;
	char result;
	long section_id;
	int sectiontime;
	float speed;
}POS_ADD_FM;

typedef struct _POS_INFO_FM
{
	POS_BASIC_FM	base_fm;
	POS_ADD_FM	add_fm;	
}POS_INFO_FM;

//0x0201 positon info search rpy
typedef struct _POSINFO_SERCHRPY_FM
{
	int altitude;
	int direction;
	float lat;
	float lng;
	float speed;
	int status;
	char time[20];
	int warning;
}POSINFO_SERCHRPY_FM;

/* 0x0702 drv info upload DRIVER */
typedef struct _DRIVER_INFO_FM
{
	char idnumber[20];
	char issue[30];		
	char license[40];
	char name[30];
}DRIVER_INFO_FM;

/* 0x0800 media event info upload MEDIAEVENT */
typedef struct _MEDIA_EVENT_FM
{
	int channel;
	char dataid[20];
	char event[30];
	char format[40];
	char type[255];
}MEDIA_EVENT_FM;

/* 0x0801 media data upload MEDIA */
typedef struct _MEDIA_DAT_FM
{
	char content[1024];	
	char dataid[20];
	char event[30];
	char format[40];
	int pos_id;
	char type[255];
}MEDIA_DAT_FM;

void term_register_trans(TERM_REG_FM *tmReg_fm);
void posInfo_report_trans(POS_INFO *pPos, POS_INFO_FM *pPos_fm);
void posInfo_search_trans(POSINFO_SERCHRPY *pPos_sech, POSINFO_SERCHRPY_FM *pPos_sechFm);
void drvInfo_upload_trans(DRIVER_INFO *drvInfo, DRIVER_INFO_FM *dvfInfoFm);
void media_event_trans(MEDIA_EVENT_UP *medEvent, MEDIA_EVENT_FM *medEventFm);
void media_data_trans(MEDIA_DAT_UP *medDat, MEDIA_DAT_FM *medDatFm);

#endif/*msg_type_fun.h */
